package com.wy.pojo;

import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import javax.persistence.Id;
import java.io.Serializable;

/**
 * @Author: wy
 * @Date:2019/10/27 11:17
 */

@Data
@Document(indexName = "person",type="doc")
public class UserTest{
        @Id
       private Long id;
      //可以设置分词器 ，默认也可以
      @Field(analyzer = "ik_smart", type = FieldType.Text)
       private String name;
    @Field(analyzer = "ik_smart", type = FieldType.Integer)
       private Integer age;
    @Field(analyzer = "ik_smart", type = FieldType.Text)
       private String sex;
     @Field(analyzer = "ik_smart", type = FieldType.Text)
       private String desc;
    //可以添加@Felid()

    public UserTest() {
    }

    public UserTest(Long id, String name, Integer age, String sex, String desc) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.desc = desc;
    }
}
